<template>
  <div class="demo-date-picker">
    <div class="block">
      <el-date-picker
        v-model="datePicked"
        type="daterange"
        unlink-panels
        range-separator="To"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        format="YYYY-MM-DD"
      />
    </div>
  </div>
</template>

<script lang="ts" setup>
import { computed } from 'vue';
const prop =  defineProps(['dateTime'])
const emit =  defineEmits(['getPickedDate'])
const datePicked =  computed({
  get(){
      return prop.dateTime
  },
  set(v:any){
    emit('getPickedDate',v)
  }
})


</script>

<style scoped>
.demo-date-picker {
  display: flex;
  width: 100%;
  padding: 0;
  flex-wrap: wrap;
}

.demo-date-picker .block {
  padding: 0 0;
  text-align: center;
  border-right: solid 1px var(--el-border-color);
  flex: 1;
}

.demo-date-picker .block:last-child {
  border-right: none;
}

.demo-date-picker .demonstration {
  display: block;
  color: var(--el-text-color-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}
</style>
